<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <script>
            function text_onkeypress() {
  if(event.keyCode==13) {
    searchClientVar.jq.click();
  }
}
        </script>
    </h:head>
    <h:body>
     
   
    
  
   <div id="col-top"></div>
    <div id="col" >
        <p:focus context="codcli" for="codcli" />  
        <h:outputText value="Codigo de Cliente"/>
        
        <p:inputText value="#{beancontroler_.codigoclientesfil}" id="codcli"  style="width: 200px;margin-left: 1%;text-transform: uppercase">
            
        </p:inputText>
        
        <p:commandButton  style="margin-left: 1%;display: none"  update="dataTable" action="#{beancontroler_.filtrasoloporidcliente()}" widgetVar="searchClientVar" value="Buscar"/>
        <p:inputText id="serch"  style="position: absolute;width: 530px;margin-left:2%;background-image: url('icons/zoom.png');background-repeat: no-repeat;padding: 3px 3px 3px 25px; background-position: 4px 1px;    " value="#{beancontroler_.filtertextclientes}">
            <p:ajax event="keyup" update="dataTable" listener="#{beancontroler_.filrarclientefulldata()}" />  
        </p:inputText>
        <p:dataTable id="dataTable" var="car" value="#{beancontroler_.clientereg}"   rowKey="#{car.id}"
                     selection="#{beancontroler_.selectedclientes}"
                     selectionMode="single"
                 paginator="true" rows="10"  
                 paginatorPosition="top"
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">  
            
            <p:ajax event="rowSelect"    update="@none"   oncomplete="updateContent()"   listener="#{beancontroler_.loadclientesregistrados()}">
             <f:param name="source" value="clientes.xhtml"/>
            </p:ajax>
        <f:facet name="header">  
            Listado de Clientes
        </f:facet>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Codigo" />  
            </f:facet>  
            <h:outputText value="#{car.codigo}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Nombre" />  
            </f:facet>  
            <h:outputText value="#{car.nombres}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Apellido" />  
            </f:facet>  
            <h:outputText value="#{car.apelldios}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Celular" />  
            </f:facet>  
            <h:outputText value="#{car.celular}" />  
        </p:column>  
            <p:column>  
            <f:facet name="header">  
                <h:outputText value="Comañia" />  
            </f:facet>  
                <h:outputText value="#{car.companiacelular}" />  
        </p:column>  
            <p:column>  
            <f:facet name="header">  
                <h:outputText value="Ultima Visita" />  
            </f:facet>  
                <h:outputText value="#{car.ultimafechavisita}" />  
        </p:column>  
    </p:dataTable> 
         
        
       <p:commandLink  id="clientes"  update="@none"  oncomplete="updateContent()" action="#{beancontroler_.loadclientes()}"  value="Nuevo Cliente">
                                               <f:param name="source" value="clientes.xhtml"/>
                                            </p:commandLink>
        
        
        
          </div> <!-- /col -->
    <div id="col-bottom"></div>

    </h:body>
</html>

